﻿using System.Collections.Generic;
using System.IO;

namespace Aeon.Emulator.Dos.VirtualFileSystem
{
    /// <summary>
    /// Describes a file system mapping that can track differences with another mapping.
    /// </summary>
    public interface IDifferencingMappedDrive : IWritableMappedDrive
    {
        /// <summary>
        /// Creates a new file, recursively creating directories if necessary.
        /// </summary>
        /// <param name="path">Path of file to create.</param>
        /// <returns>Stream backed by the new file.</returns>
        Stream CreateDifferencingFile(VirtualPath path);
        /// <summary>
        /// Marks a file as deleted even if it does not exist.
        /// </summary>
        /// <param name="path">Path of file to delete.</param>
        void DifferencingDeleteFile(VirtualPath path);

        /// <summary>
        /// Removes a directory even if it does not exist.
        /// </summary>
        /// <param name="path">Path of directory to remove.</param>
        void DifferencingRemoveDirectory(VirtualPath path);

        /// <summary>
        /// Returns the contents of a directory, including deleted items.
        /// </summary>
        /// <param name="path">Path of directory.</param>
        /// <returns>Contents of the directory.</returns>
        IEnumerable<DifferencingFileInfo> GetDifferencingDirectory(VirtualPath path);
    }
}
